<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'role.jsp' starting page</title>
  </head>
  <body>
  <div class="pageContent">
  <form onsubmit="return validateCallback(this, navTabAjaxDone);" class="pageForm required-validate" action="<%=basePath%>user/addrole.do?roleid=${role.roleid}&userId=${role.userId}" method="post">
 <div class="pageFormContent" layoutH="56">
  <table  class="table" width="100%" layoutH="78">
		<thead>
			<tr>
			    <th width="1%"></th>
			    <th width="1%"></th>
				<th width="20%">角色编号</th>
				<th width="15%">角色名</th>
				<th width="15%">简称</th>
				<th width="10%">状态</th>
			</tr>
		</thead>
		<tbody>
	    <c:forEach items="${requestScope.list}" var="role" varStatus="count">
	    <tr>
	        <td >${count.index+1}</td>
	         <c:if test="${!empty role.box}">
	        	<td >
	       		 <input type="checkbox" name="role" value="${role.roleid}" checked/>
	        	</td>
	        </c:if>
	        <c:if test="${empty role.box}">
	        	<td >
	        	<input type="checkbox" name="role" value="${role.roleid}"/>
	        	</td>
	        </c:if>
            <td>${role.roleid}</td>
            <td >${role.name}</td>
            <td>${role.short_key}</td>
            <td>${role.status}</td>
            </tr>
	    </c:forEach>
	</tbody>
	</table>
	</div>
	<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
			</div>
	</form>
	</div>
  </body>
</html>
